import React, { useState, useEffect } from 'react'

// import store from '../../store'
import { sendAction } from '../../action'

export default function Home() {
    useEffect(() => {
        console.log(this.proops.store.getState());
        return () => {
            console.log('组件销毁');
        }
    }, [this.props.store.getState().value])

    function handleClick() {
        this.proops.store.dispatch(sendAction())
    }

    return (
        <div>
            <button onClick={handleClick.bind(this)}>发送action</button>
            {this.proops.store.getState().value}
        </div>
    )
}
